<template>
  <div ref="charts" class="bar-chart" />
</template>

<script>
import * as echarts from 'echarts'
import resize from '@/minxins/resize'
export default {
  name: 'BarChart',
  mixins:[resize],
  mounted() {
    const myEcharts = echarts.init(this.$refs.charts)
    myEcharts.setOption({
      grid: {
        top: 0,
        bottom: 0,
        left: -10,
        right: -10
      },
      xAxis: {
        show: false,
        data: [
          '一月',
          '二月',
          '三月',
          '四月',
          '五月',
          '六月',
          '七月',
          '八月',
          '九月',
          '十月',
          '十一月',
          '十二月'
        ]
      },
      yAxis: {
        show: false
      },
      series: {
        type: 'bar',
        data: [23, 34, 45, 23, 57, 55, 74, 66, 84, 30, 40, 59]
      }
    })
    this.myEcharts = myEcharts
  }
}
</script>

<style lang="sass" scoped>
.bar-chart
  width: 100%
  height: 100%
</style>
